﻿///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug  4 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////

#include "HeliCtrl_GUI.h"

///////////////////////////////////////////////////////////////////////////

MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	m_statusBar = this->CreateStatusBar( 2, wxST_SIZEGRIP, ID_DEFAULT );
	m_menubar = new wxMenuBar( 0 );
	m_fileMenu = new wxMenu();
	wxMenuItem* fileExit;
	fileExit = new wxMenuItem( m_fileMenu, ID_FILE_EXIT, wxString( wxT("E&xit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Exit the application"), wxITEM_NORMAL );
	m_fileMenu->Append( fileExit );
	
	m_menubar->Append( m_fileMenu, wxT("&File") );
	
	m_helpMenu = new wxMenu();
	wxMenuItem* helpAbout;
	helpAbout = new wxMenuItem( m_helpMenu, ID_HELP_ABOUT, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("Show info about this application"), wxITEM_NORMAL );
	m_helpMenu->Append( helpAbout );
	
	m_menubar->Append( m_helpMenu, wxT("&Help") );
	
	this->SetMenuBar( m_menubar );
	
}

MainFrame::~MainFrame()
{
}

MainPanel::MainPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxBoxSizer* bSizer71;
	bSizer71 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText6 = new wxStaticText( this, wxID_ANY, wxT("RS232 port:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	bSizer71->Add( m_staticText6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxArrayString com_portChoices;
	com_port = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, com_portChoices, 0 );
	com_port->SetSelection( 0 );
	com_port->SetMinSize( wxSize( 72,-1 ) );
	
	bSizer71->Add( com_port, 0, wxALL, 5 );
	
	m_ConnectB = new wxButton( this, wxID_ANY, wxT("Connect"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer71->Add( m_ConnectB, 0, wxALL, 5 );
	
	m_ConnStatus = new awxLed( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, awxLED_RED, 0 );
	m_ConnStatus->SetState( awxLED_ON );
	bSizer71->Add( m_ConnStatus, 0, wxALL, 5 );
	
	
	bSizer71->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_DisconnectB = new wxButton( this, wxID_ANY, wxT("Disconnect"), wxDefaultPosition, wxDefaultSize, 0 );
	m_DisconnectB->Hide();
	
	bSizer71->Add( m_DisconnectB, 1, wxALL, 5 );
	
	m_test = new wxButton( this, wxID_ANY, wxT("Test"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer71->Add( m_test, 0, wxALL, 5 );
	
	mainSizer->Add( bSizer71, 0, wxALIGN_CENTER|wxEXPAND, 5 );
	
	wxBoxSizer* bSizer5;
	bSizer5 = new wxBoxSizer( wxHORIZONTAL );
	
	m_staticText4 = new wxStaticText( this, wxID_ANY, wxT("Controllers:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText4->Wrap( -1 );
	bSizer5->Add( m_staticText4, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxArrayString m_JoyListChoices;
	m_JoyList = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_JoyListChoices, 0 );
	m_JoyList->SetSelection( 0 );
	bSizer5->Add( m_JoyList, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_JoyStatus = new awxLed( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, awxLED_RED, 0 );
	m_JoyStatus->SetState( awxLED_ON );
	bSizer5->Add( m_JoyStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_JoyDraw = new wxJoyPosCtrl(this);
	m_JoyDraw->SetMinSize( wxSize( 32,32 ) );
	
	bSizer5->Add( m_JoyDraw, 0, wxRIGHT|wxLEFT, 5 );
	
	
	bSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
	
	m_JoyRefres = new wxButton( this, wxID_ANY, wxT("Reload"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer5->Add( m_JoyRefres, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	mainSizer->Add( bSizer5, 0, wxEXPAND, 5 );
	
	m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	mainSizer->Add( m_staticline2, 0, wxEXPAND|wxALL, 5 );
	
	wxStaticBoxSizer* sbSizer6;
	sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Telemetry") ), wxHORIZONTAL );
	
	wxBoxSizer* bSizer81;
	bSizer81 = new wxBoxSizer( wxVERTICAL );
	
	bSizer81->SetMinSize( wxSize( -1,150 ) ); 
	m_TelemetryChart = new wxChartCtrl(this);
	m_TelemetryChart->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	
	bSizer81->Add( m_TelemetryChart, 1, wxEXPAND, 5 );
	
	sbSizer6->Add( bSizer81, 1, wxEXPAND, 1 );
	
	wxBoxSizer* bSizer111;
	bSizer111 = new wxBoxSizer( wxVERTICAL );
	
	bSizer111->SetMinSize( wxSize( -1,150 ) ); 
	m_TelemetryChart1 = new wxChartCtrl(this);
	m_TelemetryChart1->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	
	bSizer111->Add( m_TelemetryChart1, 1, wxEXPAND, 5 );
	
	sbSizer6->Add( bSizer111, 1, wxEXPAND, 1 );
	
	wxBoxSizer* bSizer151;
	bSizer151 = new wxBoxSizer( wxVERTICAL );
	
	m_TelemetryChart2 = new wxChartCtrl(this);
	m_TelemetryChart2->SetBackgroundColour( wxColour( 255, 255, 255 ) );
	
	bSizer151->Add( m_TelemetryChart2, 1, wxEXPAND, 5 );
	
	sbSizer6->Add( bSizer151, 1, wxEXPAND, 1 );
	
	mainSizer->Add( sbSizer6, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer23;
	bSizer23 = new wxBoxSizer( wxHORIZONTAL );
	
	mainSizer->Add( bSizer23, 0, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer161;
	bSizer161 = new wxBoxSizer( wxHORIZONTAL );
	
	wxStaticBoxSizer* sbSizer2;
	sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Voltage") ), wxVERTICAL );
	
	battery_voltage = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
	battery_voltage->Wrap( -1 );
	sbSizer2->Add( battery_voltage, 0, wxALL, 5 );
	
	acl2 = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
	acl2->Wrap( -1 );
	sbSizer2->Add( acl2, 0, wxALL, 5 );
	
	acl1 = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
	acl1->Wrap( -1 );
	sbSizer2->Add( acl1, 0, wxALL, 5 );
	
	voltage_limit = new wxSlider( this, wxID_ANY, 700, 500, 1000, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
	sbSizer2->Add( voltage_limit, 0, wxALL, 5 );
	
	vll = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
	vll->Wrap( -1 );
	sbSizer2->Add( vll, 0, wxALL, 5 );
	
	bSizer161->Add( sbSizer2, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Engines pr.") ), wxVERTICAL );
	
	wxBoxSizer* bSizer162;
	bSizer162 = new wxBoxSizer( wxVERTICAL );
	
	yaw_correction_enable = new wxCheckBox( this, wxID_ANY, wxT("Yaw correction"), wxDefaultPosition, wxDefaultSize, 0 );
	yaw_correction_enable->Hide();
	
	bSizer162->Add( yaw_correction_enable, 0, wxALL, 5 );
	
	yaw_correction = new wxSlider( this, wxID_ANY, 8, 6, 12, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_LABELS|wxSL_VERTICAL );
	bSizer162->Add( yaw_correction, 0, wxALL, 5 );
	
	sbSizer3->Add( bSizer162, 1, wxEXPAND, 5 );
	
	bSizer161->Add( sbSizer3, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer5;
	sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Beep") ), wxVERTICAL );
	
	wxBoxSizer* bSizer15;
	bSizer15 = new wxBoxSizer( wxHORIZONTAL );
	
	beep_type = new wxSlider( this, wxID_ANY, 1, 0, 3, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_LABELS|wxSL_VERTICAL );
	bSizer15->Add( beep_type, 0, wxALL, 5 );
	
	beep_btn = new wxToggleButton( this, wxID_ANY, wxT("Beep"), wxDefaultPosition, wxSize( 48,48 ), 0 );
	bSizer15->Add( beep_btn, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	sbSizer5->Add( bSizer15, 1, wxEXPAND, 5 );
	
	bSizer161->Add( sbSizer5, 0, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer7;
	sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Integr. Calculations") ), wxHORIZONTAL );
	
	integr_offsets_x = new wxSlider( this, wxID_ANY, 50, 0, 1024, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_VERTICAL );
	sbSizer7->Add( integr_offsets_x, 0, wxALL, 5 );
	
	integr_offsets_y = new wxSlider( this, wxID_ANY, 50, 0, 1024, wxDefaultPosition, wxDefaultSize, wxSL_LABELS|wxSL_VERTICAL );
	sbSizer7->Add( integr_offsets_y, 0, wxALL, 5 );
	
	m_button5 = new wxButton( this, wxID_ANY, wxT("Reset"), wxDefaultPosition, wxSize( 48,48 ), 0 );
	sbSizer7->Add( m_button5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	bSizer161->Add( sbSizer7, 0, wxEXPAND, 5 );
	
	mainSizer->Add( bSizer161, 0, wxEXPAND, 5 );
	
	m_staticline41 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	mainSizer->Add( m_staticline41, 0, wxEXPAND | wxALL, 5 );
	
	wxBoxSizer* bSizer721;
	bSizer721 = new wxBoxSizer( wxVERTICAL );
	
	bSizer721->SetMinSize( wxSize( -1,50 ) ); 
	m_staticText51 = new wxStaticText( this, wxID_ANY, wxT("Telemetry snapshot:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText51->Wrap( -1 );
	bSizer721->Add( m_staticText51, 0, wxALL, 5 );
	
	telemetry_snap_shot = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxSize( -1,100 ), 0 );
	
	// Grid
	telemetry_snap_shot->CreateGrid( 1, 5 );
	telemetry_snap_shot->EnableEditing( true );
	telemetry_snap_shot->EnableGridLines( true );
	telemetry_snap_shot->EnableDragGridSize( false );
	telemetry_snap_shot->SetMargins( 0, 0 );
	
	// Columns
	telemetry_snap_shot->EnableDragColMove( false );
	telemetry_snap_shot->EnableDragColSize( true );
	telemetry_snap_shot->SetColLabelSize( 20 );
	telemetry_snap_shot->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
	
	// Rows
	telemetry_snap_shot->EnableDragRowSize( true );
	telemetry_snap_shot->SetRowLabelSize( 60 );
	telemetry_snap_shot->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
	
	// Label Appearance
	
	// Cell Defaults
	telemetry_snap_shot->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
	bSizer721->Add( telemetry_snap_shot, 1, wxALL|wxEXPAND, 5 );
	
	mainSizer->Add( bSizer721, 1, wxEXPAND, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	
	// Connect Events
	m_ConnectB->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Connect_ButtonClick ), NULL, this );
	m_DisconnectB->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Disconnect_ButtonClick ), NULL, this );
	m_test->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Test_ButtonClick ), NULL, this );
	m_JoyList->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainPanel::OnJoyChange ), NULL, this );
	m_JoyRefres->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnJoysReload ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	beep_btn->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnBeepBtn ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Connect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnIntegrReset ), NULL, this );
}

MainPanel::~MainPanel()
{
	// Disconnect Events
	m_ConnectB->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Connect_ButtonClick ), NULL, this );
	m_DisconnectB->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Disconnect_ButtonClick ), NULL, this );
	m_test->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::Test_ButtonClick ), NULL, this );
	m_JoyList->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainPanel::OnJoyChange ), NULL, this );
	m_JoyRefres->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnJoysReload ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	voltage_limit->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnVoltageLimit ), NULL, this );
	beep_btn->Disconnect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnBeepBtn ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_x->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_TOP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_BOTTOM, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_LINEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_PAGEUP, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	integr_offsets_y->Disconnect( wxEVT_SCROLL_CHANGED, wxScrollEventHandler( MainPanel::OnIntegrOffsets ), NULL, this );
	m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainPanel::OnIntegrReset ), NULL, this );
}

AboutDlg::AboutDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* mainSizer;
	mainSizer = new wxBoxSizer( wxVERTICAL );
	
	wxStaticBoxSizer* infoSizer;
	infoSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
	
	wxBoxSizer* bSizer10;
	bSizer10 = new wxBoxSizer( wxHORIZONTAL );
	
	m_icon = new wxStaticBitmap( this, ID_ABOUT_ICON, wxICON( amain ), wxDefaultPosition, wxDefaultSize, 0 );
	bSizer10->Add( m_icon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	wxBoxSizer* textSizer;
	textSizer = new wxBoxSizer( wxVERTICAL );
	
	m_staticAppName = new wxStaticText( this, ID_ABOUT_APPNAME, wxT("HeliCtrl"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticAppName->Wrap( -1 );
	m_staticAppName->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial") ) );
	
	textSizer->Add( m_staticAppName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	m_staticVersion = new wxStaticText( this, ID_ABOUT_VERSION, wxT("Version"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticVersion->Wrap( -1 );
	textSizer->Add( m_staticVersion, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	bSizer10->Add( textSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
	
	infoSizer->Add( bSizer10, 1, 0, 5 );
	
	m_staticline1 = new wxStaticLine( this, ID_DEFAULT, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	infoSizer->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
	
	m_staticCopyright = new wxStaticText( this, ID_ABOUT_COPYRIGHT, wxT("Copyright © 2009"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
	m_staticCopyright->Wrap( -1 );
	infoSizer->Add( m_staticCopyright, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
	
	mainSizer->Add( infoSizer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
	
	m_aboutDialogButtonSizer = new wxStdDialogButtonSizer();
	m_aboutDialogButtonSizerOK = new wxButton( this, wxID_OK );
	m_aboutDialogButtonSizer->AddButton( m_aboutDialogButtonSizerOK );
	m_aboutDialogButtonSizer->Realize();
	mainSizer->Add( m_aboutDialogButtonSizer, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
	
	this->SetSizer( mainSizer );
	this->Layout();
	mainSizer->Fit( this );
}

AboutDlg::~AboutDlg()
{
}
